<template>
    <div>

xxxx
<h2>{{$store.state.news}}</h2>

<h2>{{$store.state.books}}</h2>
<button @click="changeData">点击改变vuex的 数据</button>

<button @click="changeMyBooks">点击改变vuex的 books数据</button>
    </div>
</template>

<script>
export default {
    data() {
        return {
            msg:'马保国'

        };
    },
    created() {

    },
    mounted() {

    },
    methods: {
        changeData() {
            alert(1)
          this.$store.commit('changeNews')
           
        },

          changeMyBooks() {
     
            this.$store.commit('changeBooks',this.msg)
        }


     

    }
};
</script>

<style scoped   lang='css'>

</style>
